﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RenAi.Medical.BLL;

namespace RenAi.Medical.Admin
{

    public partial class xinwenzixun : System.Web.UI.Page
    {
        NewBLL bll = new NewBLL();

        private void NewMethod()
        {
            this.Repeater1.DataSource = bll.GetNewsAll();
            this.Repeater1.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                NewMethod();
            }


        }

     
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            string eName = e.CommandName;
            string news_id = e.CommandArgument.ToString();
            switch (eName)
            {
                case "Del":
                    if (bll.DelNew(news_id) > 0)
                    {
                        Response.Write("<script>alert('删除成功！');</script>");
                        NewMethod();
                    }
                    break;
            }
        }

     
    }
}